﻿
@{
    ViewData["Title"] = "Index";
    Layout = "~/Views/Shared/_Index.cshtml";
}

<div class="ibox">
    <div class="ibox-title">
        消息推送设置
    </div>
    <div class="ibox-content">
        <form class="form form-horizontal" id="form">
            <input type="hidden" id="id" name="id"/>
            <div class="form-group">
                <label class="col-sm-3 control-label required">网站域名：</label>
                <div class="col-sm-4">
                    <input type="text" class="form-control" id="site_host" name="site_host" data-rule="required;"/>
                    <span> http://www.baidu.com</span>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label required">咨询成功模板消息ID：</label>
                <div class="col-sm-4">
                    <input type="text" class="form-control" id="consulting_success" name="consulting_success" data-rule="required;"/>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label required">新诊单模板消息ID：</label>
                <div class="col-sm-4">
                    <input type="text" class="form-control" id="new_question" name="new_question" data-rule="required;"/>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label required">反馈结果通知模板消息ID：</label>
                <div class="col-sm-4">
                    <input type="text" class="form-control" id="feed_back" name="feed_back" data-rule="required;"/>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label required">打赏通知模板消息ID：</label>
                <div class="col-sm-4">
                    <input type="text" class="form-control" id="pay_notice" name="pay_notice" data-rule="required;"/>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label required">咨询结束模板消息ID：</label>
                <div class="col-sm-4">
                    <input type="text" class="form-control" id="question_end" name="question_end" data-rule="required;"/>
                </div>
            </div>
            <div class="hr-line-dashed"></div>
            <div class="form-group">
                <div class="col-sm-12 col-sm-offset-3">
                    <button class="btn btn-primary" type="submit">保存内容</button>
                </div>
            </div>
        </form>
    </div>
</div>

@section scripts{
    <script type="text/javascript">
        $(function () {
            $('#form').validator({
                stopOnError: false,
                timely: 2,
                theme: "yellow_right",
                valid: function (form) {
                    jutils.ajaxPost('/BasicData/WeiXinSet/Save', $(form).serialize(),
                        function (res) {
                            if (res.status) {

                            }
                        });
                }
            });
            loadData();
        });


        function loadData() {
            jutils.ajaxGet('/BasicData/WeiXinSet/GetModel', null, function (res) {
                var model = res.data.model;
                $('#form').initFormData(model);
            });
        }
    </script>


}






